<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>自定义组件</title>
    <script src="../js/vue.js"></script>
</head>
<body>
<div id="div">
    <my-button>我的按钮</my-button>
</div>
</body>
<script>
    Vue .component("my-button",{
        //属性
        props:["style"],
        //数据函数
        data:function () {
            return{
                msg: "我的按钮"
            }
        },
        //解析标签模板
        template:"<button style='color:fuchsia'><b>{{msg}}</b></button>"
    });

    new Vue({
        el:"#div"
    })
</script>
</html>
